home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / os2 / chapm11.zip / CHAPMAN.ST < prev    next >
Text File  |  1994-05-11  |  3KB  |  90 lines

  1.  
  2. "
  3. chapman.st - ChapMan installation script
  4. This script installs the ChapMan system
  5. Execute the script by filing it in or invoking doit.
  6. "
  7.  
  8. | srcDir dllDir file doit newApp newApp2 chappClass regVer chapManDLL path |
  9. srcDir := Prompter
  10.     prompt: 'Enter directory of the installation files'
  11.     default: Disk fullDirName.
  12. srcDir isNil ifTrue: [^nil].
  13. srcDir := Directory pathName: srcDir.
  14.  
  15. dllDir := Prompter
  16.     prompt: 'Enter directory wher to put the DLLs'
  17.     default: Disk fullDirName.
  18. dllDir isNil ifTrue: [^nil].
  19. dllDir := Directory pathName: dllDir.
  20.  
  21. (regVer := File exists: 'chapm11r.dll' in: srcDir)
  22.     ifTrue: [chapManDLL := 'chapm11r']
  23.     ifFalse: [chapManDLL := 'chapm11u'].
  24.  
  25. Transcript cr.
  26. doit := true.
  27. (Smalltalk includesKey: #ChApplication) ifTrue: [
  28.     doit := MessageBox confirm: 'ChapMan already installed. Installing a new version causes all applications and class comments to be lost. You must have saved all applications in order to recreate them. In addition you must allow the reinitialization of the
  29.  window system, which closes all windows. Proceed?'.
  30.     doit ifTrue: [
  31.         Transcript cr; show: 'Unbinding old ChapMan DLL...'.
  32.         #('chapmu' 'chapmr' 'chapm11u' 'chapm11r') do: [:each |
  33.             (ObjectLibraryBind isBound: each) ifTrue: [
  34.                 ObjectLibraryBind unBind: each]
  35.             ]
  36.         ]
  37.     ].
  38.  
  39. doit ifTrue: [
  40.     dllDir fullDirName ~= srcDir fullDirName ifTrue: [
  41.         path := dllDir fullDirName.
  42.         dllDir pathName trimBlanks size > 1 
  43.             ifTrue: [path := path copyFrom: 1 to: path size - 1].
  44.         Transcript cr; show: 'Copying (new) DLL files...'.
  45.         (Array with: 'chapmres.dll' with: chapManDLL, '.dll') do: [:each |
  46.             File copy: srcDir fullDirName, each to: path]
  47.         ].
  48.  
  49.     file := srcDir fileReadOnly: 'BugFix20.cls'.
  50.     Transcript cr; show: 'Filing in ', file pathName, '...'.
  51.     file fileIn; close.
  52.  
  53.     Transcript cr; show: 'Binding object library ', chapManDLL, '...'.
  54.     ObjectLibraryBind bindTo: chapManDLL.
  55.  
  56.     (ObjectLibraryBind isBound: 'vpmolb20') ifFalse: [
  57.         Transcript
  58.             cr; show: 'Object Library Builder not installed.';
  59.             cr; show: 'Binding object library vpmolb20.dll...'.
  60.         ObjectLibraryBind bindTo: 'vpmolb20'].
  61.         
  62.  
  63.     file := srcDir fileReadOnly: 'ChapMInt.cls'.
  64.     Transcript cr; show: 'Filing in ', file pathName, '...'.
  65.     file fileIn; close.
  66.  
  67.     Transcript cr; show: 'Filing in application data...'.
  68.     chappClass := Smalltalk at: #ChUserApplication.
  69.     #('bugfix20.cha' 'ChapMInt.cha') do: [:each |
  70.         newApp := chappClass newFromFile: srcDir fullDirName, 
  71.             each subApplications: false.
  72.         chappClass subApplication: newApp of: nil].
  73.     
  74.     newApp2 := chappClass newFromFile: srcDir fullDirName, 
  75.         'ChapMan.cha' subApplications: false.
  76.     chappClass subApplication: newApp2 of: newApp.
  77.  
  78.     #('Register.cha' 'GenTools.cha') do: [:each |
  79.         newApp := chappClass newFromFile: srcDir fullDirName,
  80.             each subApplications: false.
  81.         chappClass subApplication: newApp of: newApp2].
  82.  
  83.     Transcript cr; show: 'ChapMan installed.'; cr.
  84.     MessageBox message: 'Reinitialization of the window system will be done.'.
  85.     Notifier reinitialize]
  86.  
  87. ifFalse: [
  88.     Transcript cr; show: 'Installation aborted'] !
  89.  
  90.